feat(binding-mcp-openapi): pick up OpenAPI operation summary and description for generated tools#2028
Merged
Conversation
…ription for generated tools Parse `summary` and `description` from OpenAPI operations and wire them into the generated mcp_http tool config: `summary` feeds the (currently static) mcp_http tool summary, and tool description now falls back to the operation description before operationId. Also reorders McpHttpToolConfig fields/ctor args (summary before description) for readability. Updates create.pr fixtures in binding-mcp-openapi.spec since the OpenAPI summary field they already embedded is no longer inert.
…pr scripts The scripts are self-documenting; the summary text is inline in the read.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
mcp_openapipreviously ignored the OpenAPI operation'ssummaryfield entirely, and defaulted a tool'sdescriptionto the rawoperationIdwhen no explicitoptions.tools[].descriptionoverride was configured.This change:
summaryanddescriptionfrom OpenAPI operations (OpenapiOperation/OpenapiOperationViewincommon-openapi).operation.summaryinto the generatedmcp_httptool'ssummaryfield (the static text is used verbatim bymcp_httpas the tool-call response content, ahead of a fuller dynamic/templated summary story for later).descriptionfallback chain to: explicitoptions.tools[].descriptionoverride → OpenAPIoperation.description→operationId(previously justoperationId).operationIdis natural-language-poor (e.g.pulls/create), whiledescriptionis written prose that's far more useful for an LLM deciding whether to invoke a tool.McpHttpToolConfigfields/constructor to(name, summary, description, input, output)for readability, and updates the two call sites plus the JSON adapter's read/write order to match.binding-mcp-openapi.speck3po fixtures (create.pr,create.pr.10k): these already embedded an OpenAPIsummaryfield that was previously inert; it now becomes the literal tool-call response text, so the expected scripts are updated accordingly.Added unit tests in
McpOpenapiCompositeGeneratorTestcovering: summary pass-through, description defaulting tooperation.descriptionwhen present, and falling back tooperationIdwhen absent.Verified
mvn clean verify(checkstyle + license + unit + IT) is green acrosscommon-openapi,binding-mcp-http, andbinding-mcp-openapi, including the k3po integration tests and the spec module's peer-to-peer scripts.Fixes # (issue)
Generated by Claude Code